<?php
include("d:/collect_new/collect/reset/json_fx.php");
$httpheader=<<<TEXT
GET https://tui.taobao.com/recommend?shop_id=137888571&item_ids=670977234576&floorId=42296&callback=detail_pine&appid=6862&pSize=100&pNum=0 HTTP/1.1
Host: tui.taobao.com
Connection: keep-alive
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"
DNT: 1
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36
sec-ch-ua-platform: "Windows"
Accept: */*
Sec-Fetch-Site: same-site
Sec-Fetch-Mode: no-cors
Sec-Fetch-Dest: script
Referer: https://item.taobao.com/item.htm?spm=a2oq0.12575281.0.0.24421deb7xZJLF&ft=t&id=670977234576
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,ja;q=0.6,bg;q=0.5,zh-TW;q=0.4,ru;q=0.3,th;q=0.2


TEXT;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://collect1.longsunhd.com/collect/reset/json.php?getPhpCode=1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_POST, true );
curl_setopt($ch, CURLOPT_POSTFIELDS, array("httpheader"=>$httpheader));
curl_setopt($ch, CURLINFO_HEADER_OUT, 1);
$result=curl_exec($ch);
$request_header = preg_replace("/^((POST|GET)\s*[^\s]+)\s+http/Uixs","\\1&XDEBUG_SESSION_START=543534 HTTP",curl_getinfo($ch, CURLINFO_HEADER_OUT)).http_build_query(array("httpheader"=>$httpheader))."\r\n\r\n";
$request_header = preg_replace('/Content\-Type\:[^\r\n]+/imx','Content-Type: application/x-www-form-urlencoded',$request_header);
//echo $request_header;exit;
curl_close($ch);
$data=json_decode($result,1);
print_r($data['result'][0]);
jsonCreateTable($data['result'][0],"qc_shopro_mall_product","ymh");
jsonToTable($data['result'],"qc_shopro_mall_product","ymh","select id from ymh.qc_shopro_mall_product where itemId='{\$data['itemId']}'");